using System;
using PostSharp.Laos;

namespace XpoOneWayMultiAssociations
{
   /// <summary>
   /// This aspect notifies postsharp that the weaver needs to be called.
   /// </summary>
   [Serializable]
   public class AssociationAttributeSubAspect : ILaosTypeLevelAspect
   {
      #region Constructors

      /// <summary>
      /// Initializes a new instance of the <see cref="OtherEndFieldSubAspect"/> class.
      /// </summary>
      /// <param name="propertyName">Name of the property.</param>
      /// <param name="associationName">Name of the association.</param>
      public AssociationAttributeSubAspect(string propertyName, string associationName)
      {
         PropertyName = propertyName;
         AssociationName = associationName;
      }

      #endregion

      #region Methods

      public void CompileTimeInitialize(Type type)
      {
      }

      public bool CompileTimeValidate(Type type)
      {
         return true;
      }

      public void RuntimeInitialize(Type type)
      {
      }

      #endregion

      #region Properties

      public int AspectPriority
      {
         get { return int.MinValue; }
      }

      public string AssociationName { get; set; }
      public string FieldName { get; set; }
      public string PropertyName { get; set; }

      #endregion
   }
}